package com.demo.seckill.queue.disruptor;

import com.demo.seckill.common.config.SpringUtils;
import com.demo.seckill.service.ISeckillService;
import com.lmax.disruptor.EventHandler;

public class SeckillEventConsumer implements EventHandler<SeckillEvent> {
	
	private ISeckillService seckillService = (ISeckillService) SpringUtils.getBean("seckillService");
	
	public void onEvent(SeckillEvent seckillEvent, long seq, boolean bool) throws Exception {
		seckillService.startSeckil(seckillEvent.getSeckillId(), seckillEvent.getUserId());
	}
}